<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button>按钮1</button>
		<button type="button">按钮2</button>
		<button type="button">按钮3</button>
		<button type="button">按钮4</button>
		<button type="button">按钮5</button>
		<button type="button">按钮6</button>
		<button type="button">按钮7</butt6on>
		<button type="button">按钮8</button>
		<button type="button">按钮9</button>
		<button type="button">按钮10</button>
		<script type="text/javascript">
			var btns=document.querySelectorAll("button")
			for (let i = 0; i < btns.length; i++) {
				btns[i].addEventListener("click",fun);
				btns[i].addEventListener("mouseenter",fun);
				btns[i].addEventListener("mouseout", fun);
			}
			
			var fun=function(){
				console.log(`你${event.type}了按钮${event.target.innerHTML}`);
			}
		</script>
	</body>
</html>
